//
//  FenxiaoCenterVC.m
//  1243
//
//  Created by apple on 16/7/19.
//  Copyright © 2016年 1243. All rights reserved.
//

#import "FenxiaoCenterVC.h"
#import "FenxiaoHeaderView.h"
#import "FenxiaoCollectionView.h"
#import "FenxiaoyongjinVC.h"
#import "FenxiaoDingdanVC.h"
@interface FenxiaoCenterVC ()

@end

@implementation FenxiaoCenterVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"分销中心";
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.translucent = NO;

    
    [self createUI];
}

- (void)createUI {
    FenxiaoHeaderView *headerView = [[FenxiaoHeaderView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, 150)];
    headerView.TixianBlock = ^void() {
        [self tiXianAction];
    };
    FenxiaoCollectionView *collectionVeiw = [[FenxiaoCollectionView alloc]initWithFrame:CGRectMake(0, 150, WIDTH, WIDTH/3 *2)];
    collectionVeiw.jumpControllerBlock = ^void(NSInteger num) {
        [self jumpToController:num];
    };
    [self.view addSubview:headerView];
    [self.view addSubview:collectionVeiw];
}

#pragma mark ---- 提现按钮点击事件
- (void)tiXianAction {
    
}

#pragma mark ---- 控制器跳转
- (void)jumpToController:(NSInteger )page {
    if (page == 0) {
        FenxiaoyongjinVC *mVc = [[FenxiaoyongjinVC alloc]init];
        [self.navigationController pushViewController:mVc animated:YES];
    }else if (page == 1) {
        FenxiaoDingdanVC *mVc = [[FenxiaoDingdanVC alloc]init];
        [self.navigationController pushViewController:mVc animated:YES];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
